package com.skydonkey.dao;

import com.skydonkey.pojo.po.VideoSamples;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface VideoSamplesMapper {

    @Select("select * from video_samples where video_key = #{videoKey} order by sample_url")
    List<VideoSamples> getSamples(String videoKey);


    @Insert("insert into video_samples(video_key, sample_key, sample_url) values(#{videoKey}, #{sampleKey}, #{sampleUrl});")
    void addSamples(VideoSamples samples);

    @Delete("delete from video_samples where video_key = #{videoKey}")
    int delete(String videoKey);

}
